package com.zzptc.mzb.myapplication.Frament;

import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.zzptc.mzb.myapplication.R;

import org.w3c.dom.Text;


public class SeccndFragment extends Fragment {
    private TextView txtid,txtpsd;//实例化控件

    public SeccndFragment() {

    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,//
                             Bundle savedInstanceState) {

        View view= inflater.inflate(R.layout.fragment_seccnd, container, false);
        initView(view);
        return view;
    }

    private void initView(View view) {
        txtid=view.findViewById(R.id.txtid);
        txtpsd=view.findViewById(R.id.txtpsd);
        SharedPreferences sp=getActivity().getSharedPreferences("userinfo",Context.MODE_PRIVATE);
        int uid=sp.getInt("userid",1);
        String usn=sp.getString("username","");
        String psd=sp.getString("password","");
        txtid.setText("你好，"+uid+"号用户"+usn);
        txtpsd.setText("你的密码是："+psd);

    }
}
